<template>
  <div class="header">
    <span @click="leftClick">&lt;</span>
    <slot></slot>
    <span></span>
  </div>
</template>
<script>
export default {
  setup(props, ctx) {
    const leftClick = () => {
      ctx.emit("leftClick");
      //ctx调用父组件的自定义方法
    };
    return {
      leftClick,
    };
  },
};
</script>
<style lang="scss" scoped>
.header {
  width: 100%;
  height: 50px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}
</style>
